#include <stdio.h>
#include "FreeRTOS.h"
#include "cmsis_os.h"
#include "task.h"
#include "semphr.h"
#include "stm32f0xx_hal.h"
#include "stm32f0xx.h"
#include "bsp_uart.h"

#include "math.h"

#define  APP_UART_MOD
#include "app_uart.h"


tAPP_UART app_uart;


void app_uart_task_init(void)
{
	osThreadDef(app_uart_task, app_uart_task, osPriorityNormal, 0, 128);
  app_uart.thread_id = osThreadCreate(osThread(app_uart_task), NULL);	
}


void app_uart_init(void)
{
	app_uart_task_init();
}



void app_uart_task(void const * argument)
{
	uint8_t data[16];
	uint16_t len;
	
	app_uart.uart = &bsp_uart;

	bsp_uart_init(app_uart.uart);
	
  while (1)
  {
		//printf("test\r\n");
		
		
//		len = sprintf((char *)data, "test uart\r\n");
//		
//		bsp_uart_send_data(data, len);
		
		osDelay(1000);
  }
}

